package org.jeecg.modules.simulator.factory;

import lombok.Getter;
import org.jeecg.modules.simulator.OffTrainNumRangeGerner;
import org.jeecg.modules.simulator.SimulatorParamLoader;
import org.jeecg.modules.simulator.model.SimulatorParam;
import org.jeecg.modules.simulator.util.UnitCache;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: simulator-b20240918
 * @description:
 * @author: renzhg
 * @create: 2024-11-11 15:30
 **/
public class SimulatorDBFactory implements SimulatorParamLoader {
    @Getter
    SimulatorParam simulatorParam;

    @Override
    public void loadSimulator() {
        List<String> linestr=new ArrayList<>();
        OffTrainNumRangeGerner offTrainNumRangeGerner=new OffTrainNumRangeGerner();
        UnitCache.globalSceneBaseData.getLineMap().forEach((k,v)->{
            if(v.getOperationStatus().equals("01")){
                linestr.add(v.getLineId());
            }



        });
        simulatorParam=new SimulatorParam();
        simulatorParam.setDefaultStartTime("06:00:00");
        simulatorParam.setDefaultEndTime("22:00:00");
        simulatorParam.setDailyPassengerVolume(5000000);
        simulatorParam.setShowLines(linestr);
        simulatorParam.setAllDayStartTime("06:00:00");
        simulatorParam.setAllDayEndTime("22:00:00");
        offTrainNumRangeGerner.generateRandomOffTrainNumbers();
        simulatorParam.setOffTrainNumRangeMap(offTrainNumRangeGerner.getOffTrainNumRangeMap());

    }


}
